package com.tianqu.tms.dao;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.tianqu.tms.core.exception.TmsDaoException;
import com.tianqu.tms.dto.TransferAcceptedInfoDto;
import com.tianqu.tms.entity.TransferAcceptedInfo;

public interface TransferAcceptedInfoDao {

	/**
	 * 根据流水号查询车辆评估信息
	 */
	public TransferAcceptedInfoDto getAssessInfoBySerial(String serial) throws TmsDaoException;

	/**
	 * 
	 * 评估直接录入更受理表
	 */
	public void updateAcceptInfoAtAssess(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 查验车辆列表
	 * 
	 * @param yDay
	 * @return
	 */
	public List<TransferAcceptedInfoDto> findCheckCarList(int flag) throws TmsDaoException;

	public List<TransferAcceptedInfoDto> findCheckCarList(String vin,String licenseplate) throws TmsDaoException;
	
	/**
	 * 
	 * 待办受理部分更新过户表
	 */
	public void updateAcceptInfoAtProxy(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void updateAcceptInfoAtAdvance(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 
	 * 根据vin码查询上次评估时间和上次评估价格
	 */
	public List<TransferAcceptedInfoDto> searchLastAssessInfoByVin(String vin) throws TmsDaoException;

	/**
	 * 根据车辆编号载入过户信息
	 * 
	 * @param basicCarId
	 * @return
	 * @throws TmsDaoException
	 */
	public TransferAcceptedInfoDto getTransferByBasicCarId(String basicCarId) throws TmsDaoException;

	/**
	 * PAD查验部分更新过户信息表
	 */
	public void updateAcceptInfoAtPad(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * PAD向过户信息表插入一条数据
	 */
	public void insertCarInfoAtPad(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void insertCarInfoAtChx(TransferAcceptedInfoDto dto) throws TmsDaoException;

	
	public void updateAcceptInfoBySerial(int cyPrintNum,int lcPrintNum,String serial) throws TmsDaoException;
	
	/**
	 * 根据流水号更新过户信息表
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void updateAcceptInfoBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 根据流水号或车牌号查询过户信息
	 */
	public TransferAcceptedInfoDto searchAcceptInfoToPad(String serial, String licenseplate) throws TmsDaoException;

	public TransferAcceptedInfoDto getAcceptInfoBySerial(String serial) throws TmsDaoException;
	
	/**
	 * 根据流水号查询打印次数
	 * 
	 * @param serial
	 * @return
	 * @throws TmsDaoException
	 */
	public TransferAcceptedInfoDto findPrintNum(String serial) throws TmsDaoException;

	/**
	 * 根据流水号更新流程表打印次数
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void updateTransferLcPrintNum(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 跟新打印临证
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void updateTransferLzPrintNum(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 更新行驶证
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void updateTransferXsPrintNum(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 根据流水号或车牌号码获取过户信息
	 * 
	 * @param serial
	 * @param carLicense
	 * @param status
	 * @return
	 * @throws TmsDaoException
	 */
	public TransferAcceptedInfoDto getAcceptInfoBySerialAndCarLicense(String serial, String carLicense, int status)
			throws TmsDaoException;

	/**
	 * 根据流水号更新过户状态
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void updateAcceptMemberIdBySerial(String serial, String memberId, String attnId) throws TmsDaoException;

	public void updateAcceptStatusBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void updateAcceptStatusAloneBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	
	public void updateTransferPriceBySerial(int businessType, int transferPriceChargeType,String serial) throws TmsDaoException;
	
	/**
	 * 打印查验表
	 */
	public void updateTransferCyPrintNumBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 库存车辆打印查验表
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void updateMarketCyPrintNum(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 根据流水号查询过户状态
	 */
	public TransferAcceptedInfoDto findTransStatusBySerial(String serial) throws TmsDaoException;

	/**
	 * 立体停车场入库车辆入录
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void insertEasyCar(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 微信接口入库车辆入录
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void insertCarWithWeiChat(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 过户业务基本信息
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void insertCarResumeInfo(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 更新过户信息表库存状态
	 */
	public void updateMarketTypeBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 根据流水号更新过户信息表过户状态
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void updateTransStatusBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 过户部分更新过户表
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void updateAcceptInfoAtGh(TransferAcceptedInfoDto dto,boolean updateMatch) throws TmsDaoException;

	/**
	 * 更新交易票信息
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void updateAcceptInfoAtJYP(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 库存中更新过户信息表
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void updateAcceptInfoMarketBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 微信接口更新过户信息表
	 * 
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void updateAcceptInfoByWeiChart(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 更新图片信息
	 */
	public void updatePic(TransferAcceptedInfoDto dto) throws TmsDaoException;
	
	public List<TransferAcceptedInfoDto> getAcceptInfoByJYMonth(String month) throws TmsDaoException;

	public TransferAcceptedInfoDto getAcceptInfoByVin(String vin) throws TmsDaoException;
	/**
	 * 更新二次过户信息 状态和二次过户费
	 */
	public void updateTwiceTransPriceBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 变更原车主信息
	 */
	public void updateOwnerInfoBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 查询过户信息列表 高级处理
	 */
	public List<TransferAcceptedInfoDto> getAcceptInfoBySerialAndLicense(String serial, String license, String vin) throws TmsDaoException;
	
	public List<TransferAcceptedInfoDto> getAcceptInfoBySerialAndLicense4StatusControl(String serial, String license, String vin) 	throws TmsDaoException;

	public TransferAcceptedInfoDto getAssessInfoByLicenseplate(String licenseplate) throws TmsDaoException;
	
	/**
	 * 根据新旧车牌获取过户信息
	 * @param licenseplate
	 * @param isNew
	 * @return
	 * @throws TmsDaoException
	 */
	public TransferAcceptedInfoDto getTransferAcceptedInfoByLicenseplate(String licenseplate) throws TmsDaoException;

	public TransferAcceptedInfoDto getAssessInfoByVin(String vin) throws TmsDaoException;

	public TransferAcceptedInfoDto findByVinAtGh(String vin) throws TmsDaoException;

	//
	public TransferAcceptedInfoDto getAcceptInfoBySerial(String serial, String licensePlate) throws TmsDaoException;
	public ArrayList<TransferAcceptedInfoDto> getAllAcceptInfoBySerial(String serial, String licensePlate) throws TmsDaoException;
	public TransferAcceptedInfoDto getAcceptInfoBySerial(String serial, String licensePlate,String vin) throws TmsDaoException;
	/**
	 * 更新待办超期费用
	 */
	public void updateTransExtendPriceByEntity(TransferAcceptedInfoDto dto) throws TmsDaoException;

	/**
	 * 更新打印
	 */
	public void updatePrintInfoBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void updatePrintInfoBySerialDb(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void updatePrintInfoBySerialZy(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void updatePrintInfoBySerialLc(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void updatePrintInfoBySerialGh(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void updatePrintInfoBySerialCy(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public TransferAcceptedInfoDto findTransferByBasicCarId(String basicCarId) throws TmsDaoException;

	public void updateTransferInfoAtReback(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void insertTransInfoAtBeBack(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void updatePadMarket(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void updateLicenseBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void updateAcceptedInfoByLicenseplate(String serial, int cyCcarType, String licenseplate)
			throws TmsDaoException;

	public void updateCfileTime(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public TransferAcceptedInfoDto findCarByLicense(String licensePlate) throws TmsDaoException;

	public void updatePicChange(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public List loadReAcceptList() throws TmsDaoException;

	public List<TransferAcceptedInfoDto> findReCar(String value,int type) throws TmsDaoException;

	public boolean findTransInfobySerial(String serial) throws TmsDaoException;

	public TransferAcceptedInfoDto findTransfeAcceptedInfo(String licensePlate) throws TmsDaoException;

	public void updateTransfeAcceptedInfo(String serial, int marketType, String basicCarId, int updateUserId)
			throws TmsDaoException;

	public void updateTransferDataSyn40000(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void saveTransferDataSyn40000(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public boolean isExistTransferInfoByBasicCarId(String basicCarId) throws TmsDaoException;

	public boolean isExistTransferInfoByLicensePlate(String licensePlate) throws TmsDaoException;

	public boolean isExistTransferInfoByVin(String vin) throws TmsDaoException;

	public void insertCarTranserAcceptInfo(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public TransferAcceptedInfoDto selectNumbesByLicensePlateOrVin(TransferAcceptedInfoDto transferAcceptedInfoDto)
			throws TmsDaoException;

	/***
	 * 101接口更新
	 */
	public void updatePhoto1BySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void insertCarInfoAtWX(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void updateBasicCarIdBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void updateAcceptedInfoBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public void updateAcceptedInfoBySerialNewCar(TransferAcceptedInfoDto dto) throws TmsDaoException;

	public TransferAcceptedInfoDto findTransfeAcceptedInfoBy401(String serial) throws TmsDaoException;

	public void updatePicChangeNumWhenNull(TransferAcceptedInfoDto dto) throws TmsDaoException;
	
	public void updateTransfeAcceptedInfoBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;
	
	public TransferAcceptedInfoDto findTransferAcceptedInfoBySerial(String serial)throws TmsDaoException;
	
	public TransferAcceptedInfoDto findTransferInfoByBasicCarId(String basicCarId)throws TmsDaoException;
	/**
	 * 更新过户业务基本信息表的流程表打印信息
	 */
	public void updateTransferAcceptedLCByBasicCarId(TransferAcceptedInfoDto dto)throws TmsDaoException;
	/**
	 * 根据流水号查询打印次数（流程表和查验表）
	 * */
	public TransferAcceptedInfoDto findPrintNumInfoByBasicCarId(String basicCarId)throws TmsDaoException;
	
	public List<TransferAcceptedInfoDto> findTransferAssessInfoByVin(String vin)throws TmsDaoException;
	
	public void updateAcceptInfo4TransferConfirmBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;
	
	/**
	 * 模糊查询编号列表
	 * @return
	 * @throws TmsDaoException
	 */
	public List<String> findSerialList(String serial,int type)throws TmsDaoException;
	
	public TransferAcceptedInfoDto checkTransferCompleted(String v,int type)throws TmsDaoException;
	
	public List<String> findLicensePlateList(String serial) throws TmsDaoException;
	
	public List<String> findVinList(String serial) throws TmsDaoException;

	public void updateTransBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;
	
	public List<String> findListBySerial(String[] serial) throws TmsDaoException;
	
	public List<TransferAcceptedInfoDto> findListBySerial(String serial) throws TmsDaoException;
	
	
	/**
	 */
	public String getIdBySerial(String serial) throws TmsDaoException;
	public void updateAcceptInfo000102(TransferAcceptedInfoDto dto) throws TmsDaoException;
	public void saveAcceptInfo000102(TransferAcceptedInfoDto dto) throws TmsDaoException ;
	
	//20171229
	public TransferAcceptedInfoDto getAssessInfo001(String serial) throws TmsDaoException;
	public void updateAcceptInfo001(TransferAcceptedInfoDto dto) throws TmsDaoException;
	public void updateAcceptInfo002(TransferAcceptedInfoDto dto) throws TmsDaoException;
	
	public void updatePublicSecurityAuditBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;
	public void insertTransferRegisterInfo(TransferAcceptedInfoDto dto) throws TmsDaoException;
	public Map<String, Integer> getTransferRegisterInfo(String serial) throws TmsDaoException;
	public Map<String, Integer> getTransferAcceptedInfo(String serial) throws TmsDaoException;
	
	public void updateCarOwnerAuditBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;
	
	public String getTransferReason(String serial) throws TmsDaoException;
	public List<TransferAcceptedInfoDto> getAuditingTransfers() throws TmsDaoException;
	public List<TransferAcceptedInfoDto> getProcessingTransfers() throws TmsDaoException;
	public List<TransferAcceptedInfoDto> getAllTransfers(String serial, String vin, String licensePlate, String loginId) throws TmsDaoException;
	
	public List<TransferAcceptedInfoDto> getAuditingTransfers(String loginId) throws TmsDaoException;
	public List<TransferAcceptedInfoDto> getProcessingTransfers(String loginId) throws TmsDaoException;
	public List<TransferAcceptedInfoDto> getTransfers(String serial, String vin, String licensePlate) throws TmsDaoException;
	public List<TransferAcceptedInfoDto> getAllTransfers(String serial, String vin, String licensePlate) throws TmsDaoException;
	
	
	public void updateAcceptInfo003(TransferAcceptedInfoDto dto) throws TmsDaoException;

//	/**
//	 * 载入所有过户信息
//	 */
//	public TransferAcceptedInfoDto getAllAcceptInfoBySerial(String serial, String licensePlate) throws TmsDaoException;

    /**
     * 载入所有过户信息
     */
    public List<TransferAcceptedInfoDto> getAcceptInfo(String serial, String licensePlate) throws TmsDaoException;
    
    /** 用户和经办人是否是同一所属机构 true：是  false:不是 */
	public boolean isSameMemberIdBetweenAttnAndCar(String userId,String serial,String licensePlate) throws TmsDaoException;
	/** 更新“过户业务基本信息表 (tms_transfer_accepted_info)” */
	public void updateConformityMarkBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;
	/** 打印变更表 更新 */
	public void updateChangeTableBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;
	/** 流水号存在查询 */
	public TransferAcceptedInfoDto getAcceptInfoOnlyBySerial(String serial, String licensePlate) throws TmsDaoException;
	/** 制证受理 */
	public void updateAcceptStatusToNewLicensePlateBySerial(TransferAcceptedInfoDto dto) throws TmsDaoException;
	
    public List<TransferAcceptedInfo> findDailyAcceptInfo(String date) throws TmsDaoException;

}
